﻿@{
    ViewBag.Title = "登陆";
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Content/assets/js/common.js"></script>
    <script src="~/Content/assets/plugins/validator/validator.js"></script>
    <script type="text/javascript">
        ; (function (window, undefined, $) {
            $(document).ready(function () {

                $("#btnSave").click(function (e) {

                    $("#loginform").submit();
                });

                var submiting = false;
                $('#loginform').validator({

                    valid: function (form) {
                        if (submiting) {
                            return;
                        }
                        submiting = true;
                        FormSubmit(form, function (res) {
                            if (res.Status > 0) {
                                window.location.href = res.Data;
                            }
                            else {
                                alert(res.Message);
                            }
                            submiting = false;
                        })
                    }
                });

                $("#valiCode").click(function () {
                    this.src = "/Login/GetValidateCode?time=" + (new Date()).getTime();

                });
            });

        })(window, undefined, jQuery);
    </script>
    <style type="text/css">
        .username_text {
            background: url(../Content/Images/username.png);
            width: 40px;
            height: 40px;
            float: left;
            /*margin: 10px 0px;*/
        }

        .password_text {
            background: url(../Content/Images/password.png);
            width: 40px;
            height: 40px;
            float: left;
            /*margin: 10px 0px;*/
        }

        .login_clear {
            /*clear: both;*/
            width: 100%;
            margin: 20px 0px 20px 0px;
        }

        #GetValidateCodeDiv {
            margin-top: -60px;
            margin-left: 210px;
        }

        #btnSave {
            background-color: #c61010;
            color: #fff;
            height: 40px;
            width: 300px;
            border: 0px;
            font-size: 18px;
            font-family: 'Microsoft YaHei';
            font-weight: 600;
        }

        .input {
            padding: 5px 4px;
            min-height: 28px;
            line-height: 28px;
            border: 1px solid #d4d4d4;
            background: #fff;
            vertical-align: middle;
            color: #333;
            font-size: 100%;
        }

            .input.normal {
                width: 250px;
            }

            .input.disabled {
                border: 0px solid #d4d4d4;
            }

            .input.txt {
                width: 150px;
            }

            .input:focus {
                background: #FFFBDE;
                border-color: #d4d4d4;
                outline: 1px solid #d4d4d4;
            }

        #main_login a {
            color: #C81623;
            font-size: 16px;
            font-weight: 800;
        }

            #main_login a:hover {
                color: #C81623;
            }
    </style>
</head>
<body>
    <div class="line10"></div>
    <div id="main_body">

        <div id="main_login">
            <div id="login_left"></div>
            <div id="login_right">
                <form action="@Url.Action("login")" method="post" id="loginform">
                    <div class="login_clear"></div>
                    <div style="float: left; font-family: 'Microsoft YaHei'; font-weight: 800; font-size: 18px; color: #666;">会员登录</div>
                    <div style="float: right;">@Html.ActionLink("立即注册", "Register")&nbsp;&nbsp;<a href="/Login/ForgetPassword">　忘记密码?</a></div>
                    <div class="login_clear"></div>
                    <div style="height: 10px;"></div>
                    <div style="height: 10px;"></div>

                    <div class="login_clear"></div>
                    <div class="username_text"></div>
                    <div class="username_input">@Html.TextBox("userName", "", new { placeholder = "用户名/手机号码/邮箱", @class = "input normal" })</div>
                    <div class="login_clear"></div>
                    <div class="password_text"></div>
                    <div class="username_input">@Html.Password("userPwd", "", new { @class = "input normal" })</div>
                    <div class="login_clear"></div>
                    <div style="background: url(../Content/Images/password.png); width: 40px; height: 40px; float: left;"></div>
                    <div class="username_input">@Html.TextBox("validateCode", null, new { @class = "input txt" })</div>
                    <div class="login_clear"></div>
                    <div id="GetValidateCodeDiv">
                        <img id="valiCode" style="cursor: pointer; width: 90px; height: 40px;" src="/Login/GetValidateCode" alt="验证码" />
                    </div>
                    <div class="clear"></div>
                    <div class="login_clear"></div>
                    <div>
                        <input type="hidden" name="myurl" value="@ViewBag.Url"/>
                        <input type="button" id="btnSave" value="登　　　录" />
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="line10"></div>
</body>

</html>
